package com.zfzs.post.modules.flow.service;

import com.zfzs.post.modules.flow.domain.FlowActiv;
import com.zfzs.post.modules.flow.service.dto.FlowActivQueryCriteria;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;

/**
* @author wq
* @date 2019-10-21
*/
//@CacheConfig(cacheNames = "flowActiv")
public interface FlowActivService {

    /**
    * queryAll 分页
    * @param criteria
    * @param pageable
    * @return
    */
    //@Cacheable(keyGenerator = "keyGenerator")
    Object queryAll(FlowActivQueryCriteria criteria, Pageable pageable);

    /**
    * queryAll 不分页
    * @param criteria
    * @return
    */
    //@Cacheable(keyGenerator = "keyGenerator")
    public Object queryAll(FlowActivQueryCriteria criteria);

    /**
     * findById
     * @param activId
     * @return
     */
    //@Cacheable(key = "#p0")
    FlowActiv findById(Long activId);

    /**
     * create
     * @param resources
     * @return
     */
    //@CacheEvict(allEntries = true)
    FlowActiv create(FlowActiv resources);

    /**
     * update
     * @param resources
     */
    //@CacheEvict(allEntries = true)
    void update(FlowActiv resources);

    /**
     * delete
     * @param activId
     */
    //@CacheEvict(allEntries = true)
    void delete(Long activId);

    /**
     * 获取返现金额记录
     * @param agentId
     * @return
     */
    List<FlowActiv> findByAgentId(Long agentId);

    List<FlowActiv> findByAgentIdAndTime(Long agentId, String startDate, String endDate);

    /**
     * 查询下级激活返现给上级的返现列表
     * @param agentId
     * @param ids
     * @param startDate
     * @param endDate
     * @return
     */
    List<FlowActiv> findByAgentIdAndSubIds(Long agentId, List<Long> ids, String startDate,String endDate);

    List<FlowActiv> findByOwnerActiv(Long agentId, String startDate, String endDate);

    List<Map<String,Object>> findInfoList(Long agentId, String startDate, String endDate, Integer pageNo);

    List<FlowActiv> findBySn(String sn);

    Page<FlowActiv> findPage(FlowActivQueryCriteria criteria, Integer page, Integer size);
}